package com.stable.model;

import com.stable.spider.ths.XLSData;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;

import java.util.Arrays;
import java.util.List;

//WCXZBZC
public class WCXZBZC {

    public static void WCXZBZCwriteXls(String code, HSSFWorkbook workbook, List<XLSData> benefitList, List<XLSData> cashList, List<XLSData> debtList) {
        HSSFSheet sheet = workbook.createSheet("维持性资本支出");// 创建工作表(Sheet)
        List nullList = Arrays.asList();

        HSSFUtil.row(workbook, sheet, 0, code + ":报告参数", "科目\\时间", benefitList);
        HSSFUtil.row(workbook, sheet, 1, "", "", nullList);
        HSSFUtil.row(workbook, sheet, 2, "购建固定资产、无形资产和其他长期资产支付的现金(元)", "购建固定资产、无形资产和其他长期资产支付的现金(元)", cashList);
        HSSFUtil.row(workbook, sheet, 3, "补充资料：", "", nullList);
        HSSFUtil.row(workbook, sheet, 4, "净利润(元)", "净利润(元)", cashList);
        HSSFUtil.row(workbook, sheet, 5, "加：资产减值准备(元)", "加：资产减值准备(元)", cashList);
        HSSFUtil.row(workbook, sheet, 6, "固定资产折旧、油气资产折耗、生产性生物资产折旧(元)", "固定资产折旧、油气资产折耗、生产性生物资产折旧(元)", cashList);
        HSSFUtil.row(workbook, sheet, 7, "无形资产摊销(元)", "无形资产摊销(元)", cashList);
        HSSFUtil.row(workbook, sheet, 8, "长期待摊费用摊销(元)", "长期待摊费用摊销(元)", cashList);
        HSSFUtil.row(workbook, sheet, 9, "处置固定资产、无形资产和其他长期资产的损失(元)", "处置固定资产、无形资产和其他长期资产的损失(元)", cashList);
        HSSFUtil.row(workbook, sheet, 10, "固定资产报废损失(元)", "固定资产报废损失(元)", cashList);

        HSSFUtil.row(workbook, sheet, 11, "", "", nullList);
        HSSFUtil.rowFormula(workbook, sheet, 12, "维持性资本支出", "SUM(CS6:CS11)", benefitList, "");
        HSSFUtil.rowFormula(workbook, sheet, 13, "总资本支出", "CS3", benefitList, "");
        HSSFUtil.rowFormula(workbook, sheet, 14, "净利润", "CS5", benefitList, "");

        HSSFUtil.row(workbook, sheet, 15, "", "", nullList);
        HSSFUtil.rowFormula(workbook, sheet, 16, "维持性资本支出/净利润(基本再投资率)", "CS13/CS15", benefitList, "0.00%");
        HSSFUtil.rowFormula(workbook, sheet, 17, "资本支出/净利润(再投资率)", "CS14/CS15", benefitList, "0.00%");

    }
}
